<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript">
var base = "${base}/";
</script>
<!--框架必需-->
<script type="text/javascript" src="${base}/scripts/plugins/jquery-1.7.1.js"></script>
<script type="text/javascript" src="${base}/scripts/framework.js"></script>
<link href="${base}/css/import_basic.css" rel="stylesheet" type="text/css"/>
<link href="${base}/css/sky/style.css" rel="stylesheet" type="text/css" />
<!--引入弹窗组件-->
<script type="text/javascript" src="${base}/scripts/attention/zDialog/zDrag.js"></script>
<script type="text/javascript" src="${base}/scripts/attention/zDialog/zDialog.js"></script>
<script type="text/javascript">
$(function(){
	top.Dialog.close()
})
function goto(){
	var value=$("#text_goto").val();
	var re = /^[1-9]\d*$/;
	if(re.test(value)){
		if(value>${pageBar.getTotalPageCount()}||value<1){
			alert("输入超过限制！");
		}else{
			location.href="${pageBar.getPageUrlNoPageNumber()}"+value;
		}
	}else{
		alert("输入格式错误！");
		$("#text_goto").val("");
	}
}

function openWinUpdate(userId){
	var diag = new top.Dialog();
	diag.Title = "修改管理员信息";
	diag.URL = "${base}/oauth/user/findUserById.action?user.id=" + userId;
	diag.Height=400;
	diag.CancelEvent = function(){
		diag.innerFrame.contentWindow.location.reload();
		diag.close();
	};
	diag.show();
}
function openWinShow(userId){
	var diag = new top.Dialog();
	diag.Title = "查看管理员信息";
	diag.URL = "${base}/oauth/user/showUserById.action?user.id=" + userId;
	diag.Width=400;
	diag.Height=500;
	diag.CancelEvent = function(){
		diag.innerFrame.contentWindow.location.reload();
		diag.close();
	};
	diag.show();
}
</script>
</head>
<body>
<div id="scrollContent" class="border_gray">
	<table class="tableStyle">
		<tr>
			<th class="th-title" width="3%">序号</th>
			<th class="th-title" width="12%">管理员名称</th>
			<th class="th-title" width="12%">真实姓名</th>
			<th class="th-title" width="10%">联系电话</th>
			<th class="th-title" width="13%">电子邮箱</th>
			<th class="th-title" width="25%">联系地址</th>
			<th class="th-title" width="15%">上次登录时间</th>
			<th class="th-title" width="10%">基本操作</th>
		</tr>
			<#if (userList??) && (userList?size>0)>
				<#list userList as user>
					<tr>
						<td>${(user_index) + 1}</td>
						<td>${(user.username)!'' }</td>
						<td>${(user.realName)!'' }</td>
						<td>${(user.telephone)!'' }</td>
						<td>${(user.email)!'' }</td>
						<td>${(user.address)!'' }</td>
						<td>${(user.lastLoginDate?string('yyyy-MM-dd HH:mm:ss'))!'' }</td>
						<td>
							<span class="icon_key">${((user.lock)?string('<a href="${base}/oauth/user/unLockUser.action?user.id=${user.id}">解锁</a>', '<a href="${base}/oauth/user/lockedUser.action?user.id=${user.id}">锁定</a>'))!''}</span>
						 	<a onclick="openWinShow(${(user.id)!0})"><span class="icon_view">查看</span></a>
							<a onclick="openWinUpdate(${(user.id)!0})"><span class="icon_edit">修改</span></a>
						</td>
					</tr>
				</#list>
			<#else>
				<tr>
					<td colspan="8">暂无管理员记录</td>
				</tr>
			</#if>
	</table>
<div style="height:35px;">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
	<tr><#assign pager=pager>
		<td width="33%"><div align="left">
			<span class="pager">&nbsp;&nbsp;&nbsp;&nbsp;共有<strong>${pager.recordCount}</strong> 条记录，当前第<strong>${pager.currPageNo}</strong> 页，共 <strong>${pager.totalPageCount}</strong> 页 </span></div></td>
		<td width="67%">
			<table width="312" border="0" align="right" cellpadding="0" cellspacing="0">
				<tr>
					<td width="49"><div align="center">
					<#if (pageBar.getFirstPageUrl()?length>0) >
						<a href="${pageBar.getFirstPageUrl()}"><img src="${base}/images/pager_index.gif" width="40" height="15" /></a>
					<#else>
					<img src="${base}/images/pager_index.gif" width="40" height="15" />
					</#if>
					</div></td>
					<td width="49"><div align="center">
					<#if (pageBar.getPriorPageUrl()?length > 0) >
						<a href="${pageBar.getPriorPageUrl()}"><img src="${base}/images/pager_prev.gif" width="45" height="15" /></a>
					<#else>
	            		<img src="${base}/images/pager_prev.gif" width="45" height="15" />
					</#if>
					</div>
					</td>
					<td width="49"><div align="center">
							<#if (pageBar.getNextPageUrl()?length>0) >
							<a href="${pageBar.getNextPageUrl()}"><img src="${base}/images/pager_next.gif" width="45" height="15" /></a>
							<#else>
							<img src="${base}/images/pager_next.gif" width="45" height="15" />
							</#if>
						</div>
					</td>
					<td width="49"><div align="center">
							<#if (pageBar.getLastPageUrl()?length>0) >
							<a href="${pageBar.getLastPageUrl()}"><img src="${base}/images/pager_end.gif" width="40" height="15" /></a>
							<#else>
			            	<img src="${base}/images/pager_end.gif" width="40" height="15" />
							</#if>
						</div>
					</td>
					<td width="37" class="pager"><div align="center">转到</div>
					</td>
					<td width="22"><div align="center">
							<input type="text" name="text_goto" id="text_goto"
								style="width: 20px; height: 12px; font-size: 12px; border: solid 1px #7aaebd;" />
						</div>
					</td>
					<td width="22" class="pager"><div align="center">页</div>
					</td>
					<td width="35"><#if (pageBar.getTotalPageCount()>1) >
		            	<a href="javascript:goto();"><img src="${base}/images/pager_change.gif" width="26" height="15" /></a>
						<#else>
		            	<img src="${base}/images/pager_change.gif" width="26" height="15" />
						</#if>
					</td>
				</tr>
			</table>
		</td>
	</tr>
</table>
</div>
</div>
</body>
</html>